Repository navigation
Add the DCT reference fixtures and settle the pixel contract - #25
Merged
Merged
Conversation
Two Pillow-written JPEGs (16 x 16 RGB at 4:4:4, and the same bitmap as one component) and the bytes Pillow decodes from them are committed under Assets/jpeg, so the baseline DCT decoder starts from a reference rather than a description. The test project copies Assets/**/*.jpg to the output. ADR-005 records the contract the slice settles: Data stays the stored JPEG bytes and DecodedPixels is filled from the new decoder, so a caller can have either. The baseline (SOF0) decoder is the next step, against these fixtures and the 2-level tolerance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first step of the DCTDecode slice: a reference to decode against, and the contract the decoder will honour.
tests/.../Assets/jpeg/jpeg-444.jpg— 16 x 16 RGB, quality 95,subsampling=0(4:4:4, so chroma upsampling cannot mask a bug), written by Pillow 13.0.0;jpeg-444-expected.binis the 768 bytes Pillow decodes from it (not the source pixels — JPEG is lossy).jpeg-gray.jpgandjpeg-gray-expected.bin— the same bitmap as one component (256 bytes).Assets/**/*.jpgto the output.Datastays the stored JPEG bytes andDecodedPixelsis filled from the new decoder, so a caller can have either.ImagePixelsstops excludingDCTDecodeonceTryDecodeJpegis wired, and the budget rules then apply.Next
SOF0 (baseline) against these fixtures with a per-sample tolerance of 2; then SOF1/SOF2 with their own fixtures.
Evidence
No production code changed:
dotnet build -c Release→ 0 errors,dotnet test→ 1242 passed, and the four fixtures are in the test output.